<%@page contentType="text/html; charset=UTF-8" language="java"%>
<%@page import="com.travelsky.airchina.boarding.util.PageViewUtil"%>
<%@page import="com.travelsky.airchina.boarding.util.PageUtil"%>
<%@include file="/common/taglibs.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>管理中心 - 类目列表 </title>
	<meta name="robots" content="noindex, nofollow"/>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<link href="${ctx}/css/system/general.css" rel="stylesheet" type="text/css" />
	<link href="${ctx}/css/system/main.css" rel="stylesheet" type="text/css" />
	<script type="text/javascript" src="${ctx}/js/checkFrameSet.js"></script>
	<script type="text/javascript" src="${ctx}/js/jquery-1.4.min.js"></script>
	<script type="text/javascript" src="${ctx}/js/json.min.js"></script>
	<script type="text/javascript" src="${ctx}/js/operationTip.js"></script>
	<script type="text/javascript">
	  function queryCategory(){
	     document.getElementById("pId").value = "-1";
	     document.getElementById("listForm").submit();
	  }
	</script>
</head>
<body>
<h1>
<c:if test="${USER_OPERATION_URIS_MAP['/system/news']!=null}">
<span class="action-span"><a href="${ctx}/system/news">新建类目</a></span>
</c:if>
<span class="action-span1"><a href="#">管理中心</a>  - 类目列表 </span>
<div style="clear:both"></div>
</h1>
<%
String operationFlag = (String)request.getAttribute("operationFlag");
if(operationFlag!=null){
   if("t".equals(operationFlag)){
%>
  <ul class="actionMessage">
    <li>操作成功
    </li>
  </ul>
<%
   }else if("f".equals(operationFlag)){
%>
  <ul class="errorMessage">
    <li>操作失败
    </li>
  </ul>
<%
   }
}
%>
<form method="post" action="${ctx}/system/category/manage" id="listForm" name="listForm">
<input type="hidden" name="pId" id="pId" value="${categoryView.parentId}"/>
<table width="100%">
   <tr>
    <td align="right" width="20%">类目名称</td>
    <td align="left" width="30%"><input type="text" id="categoryName" name="categoryName" value="${categoryView.name}"/></td>
    <td align="left" width="50%"><input type="button" onclick="javascript:queryCategory();" value="查询"/></td>
   </tr>
</table>
<div class="list-div" id="listDiv">
<table width="100%" cellpadding="3" cellspacing="1" id="listTable">
  <tr>
    <th>商品目录名称</th>
    <th>状态</th>
    <th>操作</th>
  </tr>
  <c:forEach items="${list}" var="varTemp" varStatus="tempIdStatus">
  <tr>
    <td class="first-cell">
    <c:choose>
      <c:when test="${varTemp.isLeaf==0}">
    <a href="${ctx}/system/category/list?pId=${varTemp.id}" title="点击进入管理页面">${varTemp.name}</a>
      </c:when>
      <c:otherwise>
    <span title="叶子节点,该目录下已经没有子目录了">${varTemp.name}</span>
      </c:otherwise>
    </c:choose>
    </td>
    <td align="center">
    <span>
    <c:choose>
       <c:when test="${varTemp.status==1}">
    启用
       </c:when>
       <c:otherwise>
    停用
       </c:otherwise>
    </c:choose>
    </span>
    </td>
    <td align="center">
      <a href="${ctx}/system/brand?categoryId=${varTemp.id}" title="添加">添加品牌</a> |
      <a href="${ctx}/system/categoryAttribute?categoryId=${varTemp.id}" title="添加属性">添加属性</a> |
      <a href="${ctx}/system/categoryAttribute/list/${varTemp.id}" title="属性列表">属性列表</a> |
      <a href="${ctx}/system/category/update/${varTemp.id}" title="编辑">编辑</a>
    </td>
  </tr>
  </c:forEach>
  </table>
</div>
  <div class="page-navigation">
  <%
  PageUtil pageUtil = (PageUtil)request.getAttribute("pageUtil");
  if(pageUtil!=null){
	  PageViewUtil.printPage(out, pageUtil, "100%","listForm",request.getContextPath()+"/system/category/manage","_self",false);
  }
  %>
  </div>
</form>
</body>
</html>